/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.webapi.sub.ConfirmDestroyImport;
/*     */ import com.newcrm.webapi.sub.CustomerImportResult;
/*     */ import com.newcrm.webapi.sub.CustomerImportSave;
/*     */ import com.newcrm.webapi.sub.CustomerImportStep2;
/*     */ import com.newcrm.webapi.sub.DeleteImportCustomer;
/*     */ import com.newcrm.webapi.sub.ShowCustomerImport;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletConfig;
/*     */ import javax.servlet.ServletContext;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class CustomerImports extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = -3895470072771709358L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  49 */     if (!checkLogin(request)) {
/*  50 */       super.showLoginPage(request, response);
/*  51 */       return;
/*     */     }
/*     */ 
/*  54 */     String url = request.getRequestURI();
/*  55 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*     */     try {
/*  57 */       if (param != null)
/*     */       {
/*  59 */         if ((param.length == 1) && ("new".equals(param[0]))) {
/*  60 */           AbstractAction action = new ShowCustomerImport(this);
/*  61 */           action.parse(request, response);
/*  62 */           return;
/*     */         }
/*     */ 
/*  66 */         if ((param.length == 1) && 
/*  67 */           ("upload".equals(param[0])))
/*     */         {
/*  69 */           String path = getServletConfig().getServletContext()
/*  70 */             .getRealPath("uploadfiles/");
/*  71 */           AbstractAction action = new CustomerImportStep2(this, path);
/*  72 */           action.parse(request, response);
/*  73 */           return;
/*     */         }
/*     */ 
/*  77 */         if ((param.length == 1) && ("save".equals(param[0]))) {
/*  78 */           String path = getServletConfig().getServletContext()
/*  79 */             .getRealPath("uploadfiles/");
/*     */ 
/*  81 */           String indexPath = getServletConfig()
/*  82 */             .getServletContext().getRealPath("lucene/");
/*     */ 
/*  84 */           AbstractAction action = new CustomerImportSave(this, path, 
/*  85 */             indexPath);
/*  86 */           action.parse(request, response);
/*  87 */           return;
/*     */         }
/*     */ 
/*  91 */         if ((param.length == 1) && 
/*  92 */           ("result".equals(param[0]))) {
/*  93 */           CustomerImportResult action = new CustomerImportResult(this);
/*  94 */           action.parse(request, response);
/*  95 */           return;
/*     */         }
/*     */ 
/*  99 */         if ((param.length == 2) && 
/* 100 */           ("delete".equals(param[1]))) {
/* 101 */           AbstractAction action = new DeleteImportCustomer(this, 
/* 102 */             param[0], getServletConfig().getServletContext()
/* 103 */             .getRealPath("lucene/"));
/* 104 */           action.parse(request, response);
/* 105 */           return;
/*     */         }
/*     */ 
/* 109 */         if ((param.length == 2) && ("undo".equals(param[1]))) {
/* 110 */           AbstractAction action = new ConfirmDestroyImport(this, 
/* 111 */             param[0]);
/* 112 */           action.parse(request, response);
/* 113 */           return;
/*     */         }
/*     */       }
/*     */     } catch (NotFoundException e) {
/* 117 */       request.getRequestDispatcher("/errorpage.jsp").forward(request, 
/* 118 */         response);
/* 119 */       return;
/*     */     }
/*     */ 
/* 122 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/* 127 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/* 132 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/* 137 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 142 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 147 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 152 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 157 */     return null;
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 162 */     return "/customerimports";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 167 */     return null;
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.CustomerImports
 * JD-Core Version:    0.6.1
 */